<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent">
    <div class="content-parent border-hover-style">
      <div
        class="content"
        :class="{ content2: !props.info.remarks && !props.info.subTitle && !props.info.video.url && !props.info.value }"
      >
        <div class="title-parent">
          <div class="title-box">{{ props.info.text }}</div>
        </div>

        <div class="shadow-box">
          <div class="shadow-left">
            <img :src="publicUrls + 'free/style5/Auxiliaryoutlinestyle3icon1.webp'" alt="" />
          </div>

          <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
          <div class="remarks1" v-if="props.info.subTitle">
            <TextMax
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="2"
            ></TextMax>
          </div> 
          <div class="remarks2" v-else-if="props.info.remarks">
            <TextMax
              :color2="false"
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="4"
            ></TextMax>
          </div>
        </div>
        <div
          class="img-parent"
         
          :style="{ backgroundImage: `url(${publicUrls + 'free/style5/Auxiliaryoutlinestyle3icon2.webp'})` }"
        >
          <div class="img-left-parent"  v-if="(props.info.video && props.info.video.url) || props.info.value">
            <div class="img-left">
              <div class="img-box">
                <videoview
                  @click="audioplay(false)"
                  :info="props.info"
                  v-if="props.info.video && props.info.video.url"
                ></videoview>
                <div v-else
                  class="outline-cover">
                  <img
                  
                  @click="ImgVisible = true"
                  :src="urls + props.info.value + '?imageView2/3/format/webp'"
                  alt=""
                />
                </div>
              </div>
            </div>
          </div>
          <div class="img-right"  v-if="(props.info.video && props.info.video.url) || props.info.value"></div>
        </div>

        <div class="audio-parent">
          <audioCom :info="props.info" ref="audioParent" />
        </div>
      </div>
    </div>
  </div>
</template>



<script setup lang="ts">
import audioCom from './audioCom.vue';
import { publicUrls, textType } from '@/utils/minxin';
import { useProjectStore } from '@/store';
import { urls } from '@/utils/request/upload';
import { defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax5.vue';
import videoview from './../../../videoDialog/videoview.vue';

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

const ImgVisible = ref(false);
const audioRef = ref(null);
const audioParent = ref(null);
const videoRef = ref(null);
const isPlay = ref(false);
const store = useProjectStore();
const audioplay = (flag: boolean = true) => {
  audioParent.value.videoplay();
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;

  position: relative;
  margin-top: 0;
  height: 100%;
  margin-right: 140px;
}
.content-parent { 
  display: flex;
  position: relative;
  width: 405px;

  background-repeat: no-repeat;
  background-size: 100% 100%;
  -webkit-box-reflect: below -60% linear-gradient(transparent, rgba(0, 0, 0, 0.15));
}
.audio-parent {
  display: flex;
  justify-content: flex-end;
  // position: absolute;
  // bottom: 168px;
  // right: 40px;
  width: 405px;
  height: 40px;
  margin-top: 10px;
}
.content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 405px;
  margin-top: 60px;
}
.content2 {
  // justify-content: center;
}
.title-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 360px;
  height: 68px;
  background: rgba(239, 240, 238, 1);
  box-shadow: 0px 0px 6.9px 0px rgba(0, 0, 0, 0.25);
}
.title-box {
  border: 1px solid rgba(63, 95, 92, 0.2);
  width: 352px;
  height: 60px;
  // box-shadow: 0px 0px 6.9px 0px rgba(0, 0, 0, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: SourceBold;
  font-size: 20px;
  color: rgba(63, 95, 92, 1);
  line-height: 28px;
  text-align: center;
}
.shadow-box {
  position: relative;
  width: 349px;
  min-height: 36px;
  padding-bottom: 20px;
  margin-top: 25px;
}

.shadow-left {
  position: absolute;
  top: 0; 
  left: -14px;
  width: 2px; 
  height: 100%;
  background: rgba(190, 212, 206, 1);
  img {
    width: 12px;
    height: 12px;
    object-fit: contain;
    margin-top: 4px;
    margin-left: -5px;
  }
}
.subtitle { 
  width: 349px;
  font-family: SourceMedium;
  font-size: 16px;
  color: rgba(63, 95, 92, 1);
  line-height: 28px;
  text-align: center;
  font-weight: 400;
}
.img-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 405px;
  height: 194px;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.img-left-parent {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 349px;
  height: 150px;
  background: rgba(190, 212, 206, 1);
}
.img-left {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 341px;
  height: 142px;
  border: 1px solid rgba(239, 240, 238, 1);
  box-shadow: 0px 0px 11.7px 0px rgba(255, 255, 255, 0.25);
}
.img-box {
  position: relative;
  overflow: hidden;
  background: rgba(239, 240, 237, 0.5);
  width: 337px;
  height: 138px;

  :deep(video) {
    background: rgba(239, 240, 237, 0.5);
  }
  .outline-cover {
    width: 100%;
    height: 100%;
    object-fit: contain;
     overflow: hidden;
    img { 
      transition: all 0.3s;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover { 
    img { 
      transform: scale(1.2);
    }
  }
}
.img-right {
  width: 6px;
  height: 150px;
  background: rgba(178, 196, 191, 1);
}
.remarks1 {
  width: 349px;
  margin-top: 10px;
  :deep(.van-text-ellipsis) {
  }
}
.remarks2 {
  width: 349px;
  margin-top: 0px;
}
</style>
